﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace DotNetUI.Controls
{
    /// <summary>
    /// 图标按钮
    /// </summary>
    public class DotNetIconButton : Button
    {
        static DotNetIconButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(DotNetIconButton), new FrameworkPropertyMetadata(typeof(DotNetIconButton)));
        }
        /// <summary>
        /// 图标
        /// </summary>
        public ImageSource Icon { get=>(ImageSource)this.GetValue(IconProperty); set=>SetValue(IconProperty,value); }
        /// <summary>
        /// 图标属性
        /// </summary>
        public static readonly DependencyProperty IconProperty = DependencyProperty.Register(nameof(Icon),typeof(ImageSource),typeof(DotNetIconButton));
        /// <summary>
        /// 图标宽度
        /// </summary>
        public double IconWidth { get => (double)this.GetValue(IconWidthProperty); set => SetValue(IconWidthProperty, value); }
        /// <summary>
        /// 图标宽度
        /// </summary>
        public static readonly DependencyProperty IconWidthProperty = DependencyProperty.Register(nameof(IconWidth),typeof(double),typeof(DotNetIconButton));
        /// <summary>
        /// 图标高度
        /// </summary>
        public double IconHeight { get => (double)this.GetValue(IconHeightProperty); set => SetValue(IconHeightProperty, value); }
        /// <summary>
        /// 图标高度
        /// </summary>
        public static readonly DependencyProperty IconHeightProperty= DependencyProperty.Register(nameof(IconHeight),typeof(double),typeof(DotNetIconButton));
    }
}
